package com.ruoyi.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.SignInRewardMapper;
import com.ruoyi.web.domain.SignInReward;
import com.ruoyi.web.service.ISignInRewardService;

/**
 * 签到奖励Service业务层处理
 *
 * @author jiwei
 * @date 2024-05-12
 */
@Service
public class SignInRewardServiceImpl extends ServiceImpl<SignInRewardMapper, SignInReward> implements ISignInRewardService {
    @Autowired
    private SignInRewardMapper signInRewardMapper;

    /**
     * 查询签到奖励
     *
     * @param id 签到奖励主键
     * @return 签到奖励
     */
    @Override
    public SignInReward selectSignInRewardById(Long id) {
        return signInRewardMapper.selectSignInRewardById(id);
    }

    /**
     * 查询签到奖励列表
     *
     * @param signInReward 签到奖励
     * @return 签到奖励
     */
    @Override
    public List<SignInReward> selectSignInRewardList(SignInReward signInReward) {
        return signInRewardMapper.selectSignInRewardList(signInReward);
    }

    /**
     * 新增签到奖励
     *
     * @param signInReward 签到奖励
     * @return 结果
     */
    @Override
    public int insertSignInReward(SignInReward signInReward) {
            return save(signInReward)?1:0;
    }

    /**
     * 修改签到奖励
     *
     * @param signInReward 签到奖励
     * @return 结果
     */
    @Override
    public int updateSignInReward(SignInReward signInReward) {
        return updateById(signInReward)?1:0;
    }

    /**
     * 批量删除签到奖励
     *
     * @param ids 需要删除的签到奖励主键
     * @return 结果
     */
    @Override
    public int deleteSignInRewardByIds(Long[] ids) {
        return signInRewardMapper.deleteSignInRewardByIds(ids);
    }

    /**
     * 删除签到奖励信息
     *
     * @param id 签到奖励主键
     * @return 结果
     */
    @Override
    public int deleteSignInRewardById(Long id) {
        return signInRewardMapper.deleteSignInRewardById(id);
    }
}
